package com.woniuxy.goods.manaer;

import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RandomRule;
import feign.Retryer;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;

@SpringBootApplication
@EnableDiscoveryClient
@EnableFeignClients  //启动OpenFeign 远程调用
@EnableCircuitBreaker  //启动熔断器
public class GoodsManagerApplication {

    public static void main(String[] args) {
        SpringApplication.run(GoodsManagerApplication.class,args);
    }

    //全局做法
    @Bean
    public IRule randomRule(){
        return new RandomRule();
    }

    /*@Bean
    public Retryer feignRetryer() {
        return new Retryer.Default();
    }*/


}